package com.liuyfly.leetcode.questions;

import lombok.extern.slf4j.Slf4j;

/**
 * @author liuyangfang at 2022-08-31 13:51
 */
@Slf4j
public class Question0013 {
    public static int romanToInt(String s) {
        if (s.length()==1){
            switch (s){
                case "I":return 1;
                case "V":return 5;
                case "X":return 10;
                case "L":return 50;
                case "C":return 100;
                case "D":return 500;
                case "M":return 1000;
                default:throw new RuntimeException("unsupported");
            }
        }

        return -1;
    }

    public static void main(String[] args) {
    }

}
